package com.jiazhong.basic.pack0309;

import com.jiazhong.basic.pack0309.Person;

public class DemoD2 {

    private void a(Person p) {
        System.out.println("a方法中接受到的p值是：" + p);
        p.setAge(p.getAge() + 1);
        System.out.println(p);
    }

    private void b(Person p) {
        System.out.println("b方法中接受到的p值是：" + p);
        a(p);
        System.out.println("调用完a方法后p的值是：" + p);
    }

    public static void main(String[] args) {
        DemoD2 d1 = new DemoD2();
        Person p = new Person(1,"aa",23);
        d1.b(p);
    }
}
